﻿<style>
body {
	text-align:center;
	margin:0px;
}

#account_manager_content {
	position: absolute;
	z-index: auto;
	height: auto;
	width: 1000px;
	left:0px;
	top:80px;
}
#account_manager_menu {
	width:200px;
	padding-left:20px;
	height:auto;
	text-align:left;

	
}
#account_manager_top {
	width:900px;
	height:auto;
	margin-top:10px;
	padding-left:50px;
	font-family:"ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size:14px;

}

#account_manager_table {
	font-family: "ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size: 12px;
	text-align: left;
}

</style>
	<!--{include /service/service_head}-->
	<div id="account_manager_content">
	<div id="account_manager_menu">
		<ul style="padding-left : 8px, left : 0, ">
			${accountmanage_backend($oauthMap)}
		</ul>
	</div>
	
	<div id="account_manager_top">
		<p>{$msg}</p>
		<form action="/service/accountManage.php" id="indexform" method="get">
			<select name="shop_id" class="f-city">
				<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($shopList, 'id', 'shop_name'), $defaultShopId)}
			</select>
			<select id="staff_id" name="staff_id">
	           	<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($staffList, 'id', 'family_name', 'personal_name'), $staffId)}
	        </select>
			<input type="submit" name="" value="検索" />
		</form>
		<form action="/service/accountManage.php" method="post">
		<input type="hidden" name="shop_id" value="{$defaultShopId}"/>
		<input type="hidden" name="staff_id" value="{$staffId}"/>
		<table id="account_manager_table" border="1" cellpadding="0" cellspacing="0" width="900">
		<!--{loop $rightList $index $one}-->
		<tr>
			<td>
				{$index}
				<!--{if $userAuth[$one] > 0}-->
				<input type="checkbox" name="authIds[]" value="{$one}" checked="checked"/>
				<!--{else}-->
				<input type="checkbox" name="authIds[]" value="{$one}"/>
				<!--{/if}-->
			</td>
			<!--{loop $subRightList[$one] $index1 $one1}-->
			<td>
				{$index1}
				<!--{if $userAuth[$one1] > 0}-->
				<input type="checkbox" name="authIds[]" value="{$one1}" checked="checked"/>
				<!--{else}-->
				<input type="checkbox" name="authIds[]" value="{$one1}"/>
				<!--{/if}-->
			</td>
			<!--{/loop}-->
		</tr>
		<!--{/loop}-->
		<tr><td><input type="submit" value="setting" /></td></tr>
		</table>
		</form>
	<div>
	</div>
</body>
</html>
<script type="text/javascript"> 
jQuery(function(){
	$("select[name='shop_id']").bind("change", function(){
		if( $(this).val() < 1 ){
			return ;
		}
		$.get("{$webRoot}/service/searchStaff.php", "shop_id=" + $(this).val(), function(data){
			
			var options = '<option value="0">選択してください</option>';
			if( data.error == 0 ){
				for(var index in data.data){
					if( !index ){
						continue;
					}
					options = options + '<option value="' + data.data[index].id + '">' + data.data[index].family_name + " " + data.data[index].personal_name + '</option>';
					
				}
			}
			$("#staff_id").html(options);
		}, "json");
		
	});
	$("select[name='staff_id']").bind("change", function(){
		
		$("#indexform").submit();
	});
});
</script> 
</html> 